import request from '@/config/axios'
import type { Dayjs } from 'dayjs';

/** 售电签约信息信息 */
export interface ElecSignInfo {
          id: number; // ID
          consName: string; // 公司名称
          creditCode: string; // 统一信用代码
          startDate: string; // 开始时间
          endDate: string; // 结束时间
          fddbr: string; // 法定代表人
          jylxr: string; // 交易联系人
          jylxrdh: string; // 联系人电话
          affCompany: string; // 签约售电公司
  }

// 售电签约信息 API
export const ElecSignInfoApi = {
  // 查询售电签约信息分页
  getElecSignInfoPage: async (params: any) => {
    return await request.get({ url: `/knowledge/elec-sign-info/page`, params })
  },

  // 查询售电签约信息详情
  getElecSignInfo: async (id: number) => {
    return await request.get({ url: `/knowledge/elec-sign-info/get?id=` + id })
  },

  // 新增售电签约信息
  createElecSignInfo: async (data: ElecSignInfo) => {
    return await request.post({ url: `/knowledge/elec-sign-info/create`, data })
  },

  // 修改售电签约信息
  updateElecSignInfo: async (data: ElecSignInfo) => {
    return await request.put({ url: `/knowledge/elec-sign-info/update`, data })
  },

  // 删除售电签约信息
  deleteElecSignInfo: async (id: number) => {
    return await request.delete({ url: `/knowledge/elec-sign-info/delete?id=` + id })
  },

  /** 批量删除售电签约信息 */
  deleteElecSignInfoList: async (ids: number[]) => {
    return await request.delete({ url: `/knowledge/elec-sign-info/delete-list?ids=${ids.join(',')}` })
  },

  // 导出售电签约信息 Excel
  exportElecSignInfo: async (params) => {
    return await request.download({ url: `/knowledge/elec-sign-info/export-excel`, params })
  },
}
